<?php
/* @var $this VpnlistController */
/* @var $model Vpnlist */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'vpnlist-form',
	'enableAjaxValidation'=>false,
)); 
$time=date("Y-m-d H:i:s");
$login_list_id=yii::app()->request->getParam("login_list_id");
?>

	<p class="note"><?php echo Yii::t('base','Fields with <span class="required">*</span> are required.');?></p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'type'); ?>
		<?php echo $form->textField($model,'type',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'type'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'server'); ?>
		<?php echo $form->textField($model,'server',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'server'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'port'); ?>
		<?php echo $form->textField($model,'port',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'port'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'protocol'); ?>
		<?php echo $form->textField($model,'protocol',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'protocol'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'interface'); ?>
		<?php echo $form->textField($model,'interface',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'interface'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'ca'); ?>
		<?php //echo $form->textField($model,'ca'); ?>
		<?php echo $form->textArea($model,'ca',array('rows'=>12,'cols'=>30)); ?>
		<?php echo $form->error($model,'ca'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'comment'); ?>
		<?php echo $form->textArea($model,'comment',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'comment'); ?>
	</div>
	<div class="row">
		<?php 
		if($model->creater==""){
			echo $form->hiddenField($model,'creater',array('value'=>yii::app()->user->id));
		}else{
			echo $form->hiddenField($model,'creater',array('value'=>$model->creater));		
		} ?>
	</div>
	<div class="row">
		<?php 
		if($this->action->id=='update'){
		echo $form->hiddenField($model,'updater',array('value'=>yii::app()->user->id)); }?>
	</div>
	<div class="row">
		<?php 
		if($model->create_time==""){
			echo $form->hiddenField($model,'create_time',array('value'=>$time));
		}else{
			echo $form->hiddenField($model,'create_time',array('value'=>$model->create_time));
		}?>
	</div>
	<div class="row">
		<?php 
		if($this->action->id=='update'){
		echo $form->hiddenField($model,'update_time',array('value'=>$time));}?>
	</div>
	<div class="row">
	<?php 
	echo $form->LabelEx($model,'package_id');
	if($login_list_id==""){
		echo $form->dropDownList($model,'package_id',Package::model()->getSmartrouting());
	}else{
		echo $form->dropDownList($model,'package_id',Package::model()->getUserSmartrouting());
	}
	?>
	</div>
	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? Yii::t('base','Create') : Yii::t('base','Save')); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->